/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.magri.mvc.persistence;

import java.lang.reflect.Field;
import org.magri.mvc.annotation.Bean;
import org.magri.mvc.annotation.BeanField;
import org.magri.mvc.modelo.AbstractBean;

/**
 *
 * @author Magri
 */
public class DefaultDAO extends AbstractDAO {

    @Override
    public boolean insert(AbstractBean abstractBean) {
        Bean bean = abstractBean.getClass().getAnnotation(Bean.class);
        
        System.out.println("" + bean.table());
        
        Field[] declaredFields = abstractBean.getClass().getDeclaredFields();
        
        for (Field field : declaredFields) {
            BeanField annotation = field.getAnnotation(BeanField.class);
            
            System.out.println("field: " + annotation.field() + " type: " + annotation.type());
        }
        
        return true;
    }
    
    
    
}
